
AUI().ready('aui-modal', function(A) {
	
	var alertTitle = A.one("#alertTitle");
	var alertMsg = A.one("#alertMsg");
	
	var modal = new A.Modal({
		headerContent : '<H3>' + alertTitle.get('value') + '</H3>',
		bodyContent : alertMsg.get('value'),
		centered : true,
		modal : true,
		render : '#modal-alert',
		width : 400,
		height : 400
	});
	
	A.one(".alert-watchdog").on('click', function (e) {
		
		if (e.target._node.className.indexOf('yui3-widget-mask') != -1) {
			modal.destroy();
		}
		
	});
	
	modal.set ('zIndex', '5000');
	modal.render();
	
});
